package com.udf;

import com.udf.bean.CheckBean;
import com.udf.bean.CheckRoot;
import com.udf.service.IBeanReadService;
import com.udf.service.IURLConnectionService;
import com.udf.service.impl.URLConnectionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * Created by 张未然 on 2015/9/2.
 */
public class MainApp {

    private static Logger log = LoggerFactory.getLogger(MainApp.class);


    public static void main(String[] args){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
//        IBeanReadService brservice = (IBeanReadService) context.getBean("beanReadService");
//        CheckRoot checkRoot = brservice.loadCheckBean();
//        List<CheckBean> beanList = checkRoot.getCheckBeanList();
//        for (CheckBean bean : beanList) {
//           log.debug("name:"+bean.getName()+" target:"+bean.getTarget()+" keywords:");
//           if(bean.getKeywords()!=null&&!bean.getKeywords().isEmpty()){
//               for (String keyword : bean.getKeywords()) {
//                   log.debug("keyword:"+keyword);
//               }
//           }
//        }


  /*      IURLConnectionService connectionService = context.getBean(URLConnectionService.class);
        String result = connectionService.doGet("www.sina.com",null);
        System.out.println(result);*/
    }

}
